﻿using IconYuan.Model.Entity.Orders;
using IconYuan.Model.Entity.Stores;
using SqlSugar;

namespace IconYuan.Model.DTO.Orders
{
    public class OrderDto
    {
        public int order_id { get; set; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; } = string.Empty;
        public int user_id { get; set; }
        /// <summary>
        /// 商品总金额
        /// </summary>
        public decimal goods_price { get; set; }
        /// <summary>
        /// 订单金额(含优惠折扣)
        /// </summary>
        public decimal order_price { get; set; } 
        /// <summary>
        /// 实付金额(包含运费)
        /// </summary>
        public decimal pay_price { get; set; }
        /// <summary>
        /// 余额抵扣
        /// </summary>
        public decimal balance_money { get; set; }
        /// <summary>
        /// 优惠券抵扣金额
        /// </summary>
        public decimal coupon_money { get; set; }
        /// <summary>
        /// 等级抵扣金额
        /// </summary>
        public decimal grade_money { get; set; }
        /// <summary>
        /// 积分抵扣金额
        /// </summary>
        public decimal points_money { get; set; }
        /// <summary>
        /// 积分抵扣数量
        /// </summary>
        public int points_num { get; set; }
        /// <summary>
        /// 促销抵扣金额
        /// </summary>
        public decimal promotion_money { get; set; }
        /// <summary>
        /// 赠送的积分数量
        /// </summary>
        public int points_gift { get; set; } = 0;
        /// <summary>
        /// 订单状态(10 已取消, 20 代付款, 30 已付款,40 申请退款,41 申请退款退货 ,50 同意退款,60 拒绝退款, 70 已完成)
        /// </summary>
        public int order_status { get; set; } = 0;
        public int is_settled { get; set; }
        /// <summary>
        /// 订单状态描述
        /// </summary>
        public string status_desc { get; set; } = string.Empty;
        /// <summary>
        /// 收货地址
        /// </summary>
        public string address { get; set; } = string.Empty;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }
        /// <summary>
        /// 付款时间
        /// </summary>
        public DateTime pay_time { get; set; }
        /// <summary>
        /// 买家留言
        /// </summary>
        public string buyer_remark { get; set; } = string.Empty;
        /// <summary>
        /// 联系人     
        /// </summary>
        public string linkman { get; set; } = string.Empty;
        /// <summary>
        /// 联系方式
        /// </summary>
        public string phone { get; set; } = string.Empty;

        /// <summary>
        /// 所属门店
        /// </summary>
        public Shop shop { get; set; }
        public List<OrderGoods> goods{ get; set; }
    }
   
    public class OrderQueryDto
    {
        public int order_id { get; set; }
    }

    public class OrderStatusDto
    {
        /// <summary>
        /// 订单id
        /// </summary>
        public int order_id { get; set; }
        /// <summary>
        /// 状态: 30 调理中或待兑换, 70 已完成
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 工作人员user_id
        /// </summary>
        public int manage_user_id { get; set; }
    }

    public class AdminOrderQuertDto
    {
        public int order_id { get; set; } = 0;
        /// <summary>
        /// 用户id: 0 所有会员
        /// </summary>
        public int user_id { get; set; } = 0;
        /// <summary>
        /// 状态:0 所有订单, 30 调理中, 70 已完成
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 订单模型: 1 商品订单, 2 升级订单, 3 兑换订单 
        /// </summary>
        public int jump { get; set; } = 1;
        /// <summary>
        /// 手机号
        /// </summary>
        public string mobile { get; set; } = string.Empty;
        /// <summary>
        /// 是否已分佣:0 未分佣，1 已分佣
        /// </summary>
        public int is_settled { get; set; } = -1;
        public int page { get; set; } = 1;
    }
}
